<template>
  <view class="page">
    <u-navbar @leftClick="navLeftClick" :fixed="false" :title="title" placeholder bgColor="#fff"></u-navbar>
    <view class="content">
      <view class="ql-editor" v-html="content"></view>
    </view>
  </view>
</template>

<script>
import "@vueup/vue-quill/dist/vue-quill.snow.css"
import { getGrConfig } from '@/api/index'

export default {
  data() {
    return {
      title: '',
      type: {
        '1': '用户使用协议',
        '2': '隐私协议',
        '3': '关于平台',
      },
      typeName: {
        '1': 'termsUseContent',
        '2': 'privacyPolicyContent',
        '3': 'platformContent',
      },
      content: ''
    };
  },
  onLoad(options) {
    this.title = this.type[options.type]
    getGrConfig({deptId: uni.getStorageSync('userInfo').deptId || 100}).then(res => {
      this.content = res.data[this.typeName[options.type]]
    })
  },
  methods: {
  },
};
</script>

<style lang="scss" scoped>
.page {
  width: 750rpx;
  min-height: 100vh;
  background-color: #F5F5F5;
  padding-bottom: 80rpx;
  position: relative;
  .content {
    width: 702rpx;
    margin: 0 auto;
    margin-top: 12rpx;
    background: #FFFFFF;
    padding: 28rpx 24rpx 128rpx;
    font-size: 28rpx;
    color: #000000;
  }
}
</style>
